home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb.new / gdb-4.0 / gdb / symfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-24  |  5.0 KB  |  160 lines

  1. /* Definitions for reading symbol files into GDB.
  2.    Copyright (C) 1990  Free Software Foundation, Inc.
  3.  
  4. This file is part of GDB.
  5.  
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* This file requires that you first include "bfd.h".  */
  21.  
  22. /* Data structures and function definitions for dealing with
  23.    symbol table reading from files.  */
  24.  
  25. /* Structure to keep track of symbol reading functions for various
  26.    object file types.  */
  27.  
  28. struct sym_fns {
  29.  
  30.   /* sym_name
  31.      is the name, or name prefix, of the BFD "target type" that this
  32.      set of functions handles.  E.g. "a.out" or "sunOs" or "coff".  */
  33.  
  34.   char *sym_name;
  35.  
  36.   /* sym_namelen
  37.      counts how many bytes of sym_name should be checked against the
  38.      BFD target type of the file being read.  If an exact match is
  39.      desired, specify the number of characters in sym_name plus 1 for the
  40.      NUL.  If a prefix match is desired, specify the number of characters in
  41.      sym_name.  */
  42.  
  43.   int sym_namelen;
  44.  
  45.   /* sym_new_init
  46.      initializes anything that is global to the entire
  47.      symbol table.  It is called during symbol_file_add, when
  48.      we begin debugging an entirely new program.  */
  49.  
  50.   void (*sym_new_init) ();
  51.  
  52.   /* sym_init (sf)
  53.      reads any initial information from a symbol file, and
  54.      initializes the struct sym_fns SF in preparation for sym_read().
  55.      It is called every time we read a symbol file for any reason.  */
  56.  
  57.   void (*sym_init) ();
  58.  
  59.   /* sym_read (sf, addr, mainline)
  60.      reads a symbol file into a psymtab (or possibly a symtab).
  61.      SF is the struct sym_fns that sym_init initialized.  ADDR
  62.      is the offset between the file's specified start address and
  63.      its true address in memory.  MAINLINE is 1 if this is the
  64.      main symbol table being read, and 0 if a secondary
  65.      symbol file (e.g. shared library or dynamically loaded file)
  66.      is being read.  */
  67.  
  68.   void (*sym_read) ();
  69.  
  70.   /* sym_bfd
  71.      is the accessor for the symbol file being read.  */
  72.  
  73.   bfd  *sym_bfd;
  74.  
  75.   /* sym_private
  76.      is where information can be shared among sym_init and sym_read.
  77.      It is typically a pointer to malloc'd memory.  */
  78.  
  79.   char *sym_private;            /* Should be void * */
  80.  
  81.   /* next
  82.      finds the next struct sym_fns.  They are allocated and initialized
  83.      in whatever module implements the functions pointed to; an 
  84.      initializer calls add_symtab_fns to add them to the global chain.  */
  85.   struct sym_fns *next;
  86. };
  87.  
  88.             /*   Functions   */
  89.  
  90. extern int  free_named_symtabs ();
  91. extern void fill_in_vptr_fieldno ();
  92. extern void add_symtab_fns ();
  93.  
  94. /* Functions for dealing with the misc "function" vector, really a misc
  95.    address<->symbol mapping vector for things we don't have debug symbols
  96.    for.  */
  97.  
  98. extern void init_misc_bunches ();
  99. extern void prim_record_misc_function ();
  100. extern void discard_misc_bunches ();
  101. extern void condense_misc_bunches ();
  102.  
  103. /* Sorting your symbols for fast lookup or alphabetical printing.  */
  104.  
  105. extern void sort_block_syms ();
  106. extern void sort_symtab_syms ();
  107. extern void sort_all_symtab_syms ();
  108. extern void sort_block_syms ();
  109.  
  110. /* Make a copy of the string at PTR with SIZE characters in the symbol obstack
  111.    (and add a null character at the end in the copy).
  112.    Returns the address of the copy.  */
  113.  
  114. extern char *obsavestring ();
  115.  
  116. /* Concatenate strings S1, S2 and S3; return the new string.
  117.    Space is found in the symbol_obstack.  */
  118.  
  119. extern char *obconcat ();
  120.  
  121.             /*   Variables   */
  122.  
  123. /* File name symbols were loaded from.  */
  124.  
  125. extern char *symfile;
  126.  
  127. /* The modification date of the file when they were loaded.  */
  128.  
  129. extern long /* really time_t */ symfile_mtime;
  130.  
  131. /* Vectors of all partial symbols read in from file.  */
  132.  
  133. extern struct psymbol_allocation_list {
  134.   struct partial_symbol *list, *next;
  135.   int size;
  136. } global_psymbols, static_psymbols;
  137.  
  138. /* Support for complaining about things in the symbol file that aren't
  139.    catastrophic.
  140.  
  141.    Each such thing gets a counter.  The first time we have the problem,
  142.    during a symbol read, we report it.  At the end of symbol reading,
  143.    if verbose, we report how many of each problem we had.  */
  144.  
  145. struct complaint {
  146.   char *message;
  147.   unsigned counter;
  148.   struct complaint *next;
  149. };
  150.  
  151. /* Root of the chain of complaints that have at some point been issued. 
  152.    This is used to reset the counters, and/or report the total counts.  */
  153.  
  154. extern struct complaint complaint_root[1];
  155.  
  156. /* Functions that handle complaints.  (in symfile.c)  */
  157.  
  158. int complain();
  159. void clear_complaints();
  160.